# source:https://www.lanqiao.cn/problems/3519/learning/ 一维DP
s = input().strip()
n = len(s)

dp = [0] * n

for i in range(1, n):
    if s[i] == s[i - 1] or s[i] == "?" or s[i - 1] == "?":
        dp[i] = dp[i - 2] + 1
    else:
        dp[i] = dp[i - 1]

print(dp[-1])

# source:https://www.lanqiao.cn/problems/3534/learning/?isWithAnswer=true 
import sys
from math import inf

sys.setrecursionlimit(2000)  # 增加递归深度

# 读取输入
n, m = map(int, input().split())
store = [tuple(map(int, input().split())) for _ in range(n)]  # (Dis, Cost, Limit)

# 记忆化字典
memo = {}

def dfs(i, fuel):
    """ 计算从加油站 i 开始，当前油量 fuel 下的最小加油花费 """
    if i >= n:  # 到达终点
        return 0
    if fuel < store[i][0]:  # 油不够去下一个站
        return inf
    if i == n - 1:  # 终点站，不需要再加油
        return 0
    if (i, fuel) in memo:  # 记忆化剪枝
        return memo[(i, fuel)]

    # 1️⃣ 不加油，直接去下一站
    res = dfs(i + 1, fuel - store[i][0])

    # 2️⃣ 尝试加 `1 ~ max_add` 升油
    max_add = min(store[i][2], m - (fuel - store[i][0]))  # 不能超过站点限制，也不能超过油箱容量
    for k in range(1, max_add + 1):  
        cost = k * store[i][1]  # 计算加油花费
        res = min(res, dfs(i + 1, fuel - store[i][0] + k) + cost)

    memo[(i, fuel)] = res  # 记忆化存储
    return res

# 计算最优解
result = dfs(0, m)
print(result if result != inf else -1)

# source:https://www.lanqiao.cn/problems/3530/learning/?isWithAnswer=true DP
import os
import sys

# 请在此输入您的代码
MOD = 998244353
n, m = map(int, input().split(' '))
store = list(map(int, input().split(' ')))

f = [[0]*(410) for _ in range(310)]
f[0][m] = 1
for i in range(n):
  for j in range(m, -1, -1):
    for k in range(1, m-j+1):
      f[i+1][j] += f[i][j+k]*k%MOD*store[i]%MOD
      f[i+1][j] %= MOD

ans = 0
for i in range(1, m+1):
  ans += f[n][i]
  ans %= MOD

for i in range(1, n+1):
  ans += f[i][0]
  ans %= MOD
print(ans)
